package edu.bluebeanforum.mapper;

import edu.bluebeanforum.model.Article;
import edu.bluebeanforum.model.Board;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.smartcardio.ATR;
import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

//    查询帖子列表
    List<Article> selectAll();
//    根据板块id 查询板块内的帖子列表
    List<Article> selectAllByBoardId(@Param("boardId") Long boardId);
//    根据帖子id查询详情
    Article selectDetailById(@Param("id") Long id);
//   根据用户id 查询帖子列表
    List<Article> selectByUserId(@Param("userId") Long userId);
}